package com.yansu.cloud.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yansu.cloud.bean.User;
import com.yansu.cloud.repository.UserRepository;

/**
 * 
 * @author 言肃
 * @email yansu_code@126.com
 * @version 1.0
 * @date Jul 23, 2018 6:00:52 PM
 */
@Service
public class UserService {

	@Autowired
	private UserRepository userRepository;

	/**
	 * @param id
	 * @return
	 */
	public User findUserById(Long id) {
		return userRepository.findOne(id);
	}

	/**
	 * @return
	 */
	public List<User> getAllUsers() {
		return userRepository.findAll();
	}
}
